//
//  SPJoinInViewController.m
//  ServiceProvider
//
//  Created by 孔六五 on 15/4/13.
//  Copyright (c) 2015年 孔六五. All rights reserved.
//

#import "SPJoinInViewController.h"

@interface SPJoinInViewController ()<UIWebViewDelegate>

@end

@implementation SPJoinInViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.view.backgroundColor = RGB(232, 232, 232);
    
    [self ui_title:@"来问律师加盟" withLeftImageName:@"button_back.png" withReftImageName:nil];
    [self.button_left addTarget:self action:@selector(btn_JoinInBack:) forControlEvents:UIControlEventTouchUpInside];
    
    UIWebView *webContent = [[UIWebView alloc] initWithFrame:CGRectMake(0, self.view_title_super.frame.origin.y + self.view_title_super.frame.size.height - 69, MainScreenWidth, MainScreenHeight - self.view_title_super.frame.origin.y - self.view_title_super.frame.size.height + 69)];
    [webContent setDelegate:self];
    webContent.scrollView.bounces = NO;
    [webContent setBackgroundColor:[UIColor clearColor]];
    for (UIView *aView in [webContent subviews]){
        if ([aView isKindOfClass:[UIScrollView class]]){
            [(UIScrollView *)aView setShowsVerticalScrollIndicator:NO]; //右侧的滚动条 （水平的类似）
            for (UIView *shadowView in aView.subviews){
                if ([shadowView isKindOfClass:[UIImageView class]]){
                    shadowView.hidden = YES;  //上下滚动出边界时的黑色的图片 也就是拖拽后的上下阴影
                }
            }
        }
    }
//    本地环境：http://www.kfw.test/help/appjoining.html
//    测试环境：http://www.test.kuaifawu.com/help/appjoining.html
//    线上环境：http://www.kuaifawu.com/help/appjoining.html
    [webContent loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.mikecrm.com/f.php?t=SMD5Fr"]]];
    [self.view addSubview:webContent];
    [self.view bringSubviewToFront:self.view_title_super];
}

#pragma mark - 按钮点击事件 -
- (void)btn_JoinInBack:(id)sender
{
    [self popViewController];
}

- (void)webViewDidStartLoad:(UIWebView *)webView{
    // CS 快法务 KLW 2014-12-23
    //    [UIUtils view_showProgressHUD:@"加载中,请稍候..." inView:self.view withType:0];
    //
    [SVProgressHUD showWithStatus:@"加载中,请稍候..." maskType:SVProgressHUDMaskTypeClear];
    // CE 快法务 KLW 2014-12-23
}

- (void)webViewDidFinishLoad:(UIWebView *)webView{
    // CS 快法务 KLW 2014-12-23
    //    [UIUtils view_hideProgressHUDinView:self.view];
    //
    [SVProgressHUD dismiss];
    // CE 快法务 KLW 2014-12-23
}
@end
